package com.hsgene.authority.exception;

import com.hsgene.common.util.exception.ErrorCode;

/**
 * 权限模块错误码定义
 *
 * @author wangbing
 * @version 1.0, 2018/7/19
 */
public enum AuthorityErrorCode implements ErrorCode {

    /**
     * URL不存在
     */
    EXCLUDE_LOGIN_URL_NOT_EXISTED(20020, "Error_Authority_Exclude_Login_Url_Not_Existed", "URL不存在"),

    /**
     * 无权访问
     */
    USER_PERMISSION_NOT_ENOUGH(20021, "Error_Authority_User_Permission_Not_Enough", "无权访问"),

    PARENT_PERMISSION_NOT_EXISTED(20022, "Error_Authority_Parent_Permission_Not_Existed", "上级权限不存在"),

    POSITION_PERMISSION_DUPLICATE(20023, "Error_Authority_Position_Permission_Duplicate", "当前位置已有其他权限"),

    PERMISSION_TREE_NOT_EXISTED(20024, "Error_Authority_Permission_Tree_Not_Existed", "系统尚未配置权限信息，请联系管理员！"),

    PLATFORM_PARAM_NOT_EXISTED_OR_ERROR(20025, "Error_Authority_Platform_Not_Existed_Or_Error", "platform参数不存在或类型错误"),

    PERMISSION_NOT_EXISTED(20026, "Error_Authority_Permission_Not_Existed", "权限信息不存在"),

    PERMISSION_NAME_DUPLICATE(20027, "Error_Authority_Permission_Name_Duplicate", "当前权限名称重复"),

    COMMON_PERMISSION_CANNOT_ADD_CHILD(20028, "Error_Authority_Common_Permission_Cannot_Add_Child", "通用权限不允许添加子权限"),

    PERMISSION_CANNOT_TO_COMMON(20029, "Error_Authority_Permission_Cannot_To_Common", "存在子权限，不允许改为通用权限"),

    PERMISSION_CANNOT_DELETE(20030, "Error_Authority_Permission_Cannot_Delete", "权限正在使用中，无法删除");

    private final int code;

    private final String message;

    private final String description;

    AuthorityErrorCode(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String getDescription() {
        return description;
    }
}
